package com.etc.servlet.user;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

public class AppServlet extends HttpServlet{

	@Override
	public void init(ServletConfig config) throws ServletException {
		ServletContext appliction = config.getServletContext();
		
		// TODO连接数据库 MOCK
		List<HashMap> mlist = new ArrayList<HashMap>();
		HashMap<String,String> map1 = new HashMap<>();
		mlist.add(map1);
		map1.put("key", "DL2001");
		
		HashMap<String,String> map2 = new HashMap<>();
		mlist.add(map2);
		map2.put("key", "DL2002");
		
		HashMap<String,String> map3 = new HashMap<>();
		mlist.add(map3);
		map3.put("key", "DL2003");
		
		
		appliction.setAttribute("clist", mlist);
	}

}
